<template>
	<view v-for="item in datalist" style="padding: 5rpx;background-color: #eee;">
		<newsView :nID="item.nID" :title="item.title" :author="item.author" :comments="item.comments" :time="item.time"
			:isTop="item.isTop" :mode="item.newstype" :image="item.image" :showSearch="item.showSearch"
			:bgColor="item.bgColor">
			<template v-slot:tips>
				<view class="slotcontent" v-if="item.showSearch">
					<text class="s-lable">搜索：</text>
					<view class="borderbox"><text>{{item.s1}}</text></view>
					<view class="borderbox"><text>{{item.s2}}</text></view>
				</view>
			</template>
		</newsView>

	</view>
</template>

<script>
	import newsView from '../../../components/newsView.vue';
	export default {
		components: {
			newsView
		},
		data() {
			return {
				datalist: [{
						nID: "T15627",
						newstype: 1,
						title: "乘势而上，续写中国奇迹新篇章——党的二十届四中全会侧记",
						isTop: true,
						author: "新华社",
						comments: 56,
						time: "2025.10.28",
						
					},
					{
						nID:"B4485",
						title: "跨国车企齐聚进博会：从“参展”到“扎根”",
						isTop: true,
						newstype:2,
						author: "财经杂志",
						comments: 102,
						time: "2025.11.6",
						image:"/static/news1_gif.jpeg"
					},
					{
						title: "黄金还能走多远？卖方高呼“第三浪启动”，230多份研报看多",
						author: "财联社",
						isTop: false,
						comments: 452,
						time: "2025.10.28",
						showSearch: true,
						s1: "今日金价",
						s2: "精选好物"
					},
					{
						title: "发挥亚太引领作用，习近平这样强调",
						isTop: false,
						author: "人民日报",
						comments: 187,
						time: "2025.10.31"
					}

				]
			}
		},
		methods: {

		}
	}
</script>

<style>
	.slotcontent {
		display: flex;
		align-items: center;
		margin-top: 10rpx;
		gap: 15rpx;
	}

	.borderbox {
		border: 1rpx solid #ccc;
		border-radius: 20rpx;
		padding: 4rpx 18rpx;
		margin-right: 15rpx;
		font-size: 24rpx;
		color: blueviolet
	}

	.s-lable {
		font-size: 26rpx;
		color: blueviolet;
		margin-right: 15rpx
	}
</style>